﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GylCSharpUtils.Common.Utils {
    public class RandomUtils {

        public static long RandomLong() {
            return (((long)RandomInt()) << 32) | ((long)RandomInt() & 0x00000000_fffffffff);
        }

        public static int RandomInt() {
            return new Random().Next();
        }

        public static int RandomInt(int min, int max) {
            if(max < min) {
                var tmp = max;
                max = min;
                min = tmp;
            }
            var range = max - min;
            return (int)(new Random().NextDouble() * range)+min;
        }
    }
}
